package cn.iocoder.yudao.module.member.dal.mysql.userbackamount;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.userbackamount.UserBackAmountDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.userbackamount.vo.*;

/**
 * 用户提现/退款记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBackAmountMapper extends BaseMapperX<UserBackAmountDO> {

    default PageResult<UserBackAmountDO> selectPage(UserBackAmountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBackAmountDO>()
                .betweenIfPresent(UserBackAmountDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserBackAmountDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBackAmountDO::getWithdrawalType, reqVO.getWithdrawalType())
                .eqIfPresent(UserBackAmountDO::getBackType, reqVO.getBackType())
                .eqIfPresent(UserBackAmountDO::getBackUrl, reqVO.getBackUrl())
                .eqIfPresent(UserBackAmountDO::getStatus, reqVO.getStatus())
                .eqIfPresent(UserBackAmountDO::getBackComputeAmount, reqVO.getBackComputeAmount())
                .likeIfPresent(UserBackAmountDO::getUserName, reqVO.getUserName())
                .orderByDesc(UserBackAmountDO::getId));
    }

}